Conventionally, it is well known that a motor controller controls a switch of an H-bridge circuit to control an energization of a motor and a rotation direction of the motor. Japanese Patent No. 4382768 discloses that a controller of a DC motor which is applied to an electric power steering device has a configuration to include a motor-current detection circuit detecting a voltage between two ends of a shunt resistor connected with an H-bridge circuit in series connection. The above motor controller executes a sample hold of an output of the motor-current detection circuit at every half period of an output of a switching-element driving circuit, and detects an absolute value of a current flowing through a motor and a current direction of the current based on a value obtained by subtracting one of two sampling values from the other one of the two sampling values which are obtained every half period.